<?php
class admin extends JXZModel
{
    var $pk ="id";
    var $table="jxz_admin";
    
    var $verifier_login=array(
         "rules"=>array(
            'username'=>array(
               'notnull'=>TRUE,
            ),
            'userpassword'=>array(
                'notnull'=>TRUE,
            ),
         ),
         
         "messages"=>array(
            'username'=>array(
               'notnull'=>"用户名不能为空",
            ),
             'userpassword'=>array(
               'notnull'=>"密码不能为空",
             ),
         ),
    );
        var $verifier_pwedit=array(
         "rules"=>array(
            'us_password'=>array(
                'notnull'=>TRUE,
            ),
         ),
         
         "messages"=>array(
             'us_password'=>array(
               'notnull'=>"填写新密码",
             ),
         ),
    );
    
    
    
    public function userlogin($us_name,$us_password){
        $conditions=array(
           'username'=>$us_name,
           'userpassword'=>$us_password,
        );
        	if( $result = $this->find($conditions) ){ 
			spClass('spAcl')->set($result['aclname']); 
			$_SESSION["userinfo"] = $result; 
			return true;
		}else{
			return false;
		}